﻿using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using LiftHub.Data.TodoModels;

namespace LiftHub.Controls;

public partial class AddStepControl : UserControl
{
    public AddStepControl()
    {
        InitializeComponent();
    }
    
    public StepModel? Done()
    {
        if (string.IsNullOrEmpty(Context.Text)) return null;
        return new StepModel()
        {
            Context = Context.Text,
            EndTime = EndTime.SelectedDate.ToString()!, 
            IsDone = IsDone.IsChecked!.Value
        };
    }
}